<a target="_blank" class="btn btn-info" href="up_imgOrVideo.php">上传图片或视频</a>
<span class="btn btn-success" id="add_face" >添加表情</span>
<div id="add_face_div" class="hid">
	<h3 class="text-center bg-primary">选择一个表情</h3>
<?php
	$dir="../../files/face";
	$faceDir=scandir($dir);
	$arrFace=array_diff($faceDir, [".",".."]);
	foreach($arrFace as $v){
		echo '<img onclick="func(this)" src="/files/face/'.$v.'" alt="'.$v.'"/>';
	}
?>
	<h3 class="text-center bg-primary">请复制以下代码到编辑器：</h3>
	<p id="face">选择一个表情，然后复制这里的代码到编辑器。</p>
</div>
<script type="text/javascript">
	function func(img){
		var faceUrl='&lt;img src="/files/face/'+img.alt+'"/&gt';
		face.innerHTML=faceUrl;
	}
document.getElementById("add_face").onclick=function(){
	document.getElementById("add_face_div").style.display="block";
}
</script>